package rest.jbpm.wrappers.lists;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rest.jbpm.wrappers.Deployment;

@XmlRootElement
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(name = "deployments", propOrder = {
    "deployments"})
public class DeploymentList {

	private List<Deployment> deployments;
	private static final Logger log = LoggerFactory.getLogger(DeploymentList.class);
	
	protected DeploymentList() {
		
	}
	
	public DeploymentList(Collection<? extends org.jbpm.api.Deployment> depls) {
		
		deployments = new ArrayList<Deployment>();
		
		for(org.jbpm.api.Deployment dep : depls)
			deployments.add(new Deployment(dep));

	}
	
	@XmlElement(name="deployment",required=true)
	public List<Deployment> getDeployments() {
		return deployments;
	}
}
